<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/header.jsp" %>
<div class="row">
	<div class="col-xs-12">
		<!-- PAGE CONTENT BEGINS -->
		<div class="row">
			<div class="col-xs-12">
				<div class="table-header">
					统计列表
				</div>

				<!-- div.table-responsive -->

				<!-- div.dataTables_borderWrap -->
				<div>
					<table id="dataTables" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
							    <th class="text-center"><b>序号</b></th>	
								<th class="text-center"><b>用户所属机构</b></th>
								<th ></th>
								<th class="text-center"><b>登陆次数</b></th>	
							</tr>
						</thead>


						<tbody>
						   <c:forEach  var="loginfo" items='${loginfoStatistiscs}' varStatus="log">
								<tr>
									<td >${log.index+1}</td>
									<td ><hw:orgName orgId='${loginfo.orgId}'/></td>
									<td >${loginfo.orgId}</td>
									<td >${loginfo.times}</td>
								</tr>
							</c:forEach>						
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div><!-- /.col -->
</div><!-- /.row -->
<div class="hr hr-18 dotted hr-double"></div>
	<div id="detailInfos" ></div>
	
	
<!-- page specific plugin scripts -->
<script type="text/javascript">
	var oTableSub;		
	var scripts = [null, null];
	$('.page-content-area').ace_ajax('loadScripts', scripts, function() {
		oTableSub = $("#dataTables").dataTable({
		    "bAutoWidth": false,	
		    "bDestroy":true,
		    "aoColumnDefs": [{"bSortable": false, "aTargets": [ 1 ]},{"visible":false,"targets": [ 2 ],"searchable": false}],
			"oLanguage":oLanguage
		});
		
		$("#dataTables").on("click", "tbody tr" , function(){
			var active_class = "success";
			var $row = $(this).closest("tr");	
			if ($row.hasClass(active_class) == false) {
				oTableSub.$("tr." + active_class).removeClass(active_class);
				$row.addClass(active_class);				
			}
			
			var aData = oTableSub.fnGetData(this); 
			var startTime = $("#startTime").val();
			var endTime = $("#endTime").val();
			//var startTime = startTime.replace(/-/g,'')+'000000';
	    	//var endTime = endTime.replace(/-/g,'')+'235959';
	        var params =  { "startTime":startTime, "endTime": endTime, "orgId":aData[2]};
			$("#detailInfos").load("${ctx}/logInfo/detail", params);
			$("#detailInfos").show(); 
		});	
	});
</script>




